package Data;

/*
和最大的向量
 */
public class vector {

  public static void main(String[] args) {

    int num[] = {1,3,5,-7,8};

    int cur = Integer.MIN_VALUE;

    int sum = 0;

    for(int i=0;i<num.length;i++){
      sum = sum + num[i];

      cur = Math.max(sum, cur);

    }
    System.out.println(cur);

  }
}
